}
#endif
+#ifndef __HAVE_ARCH_MEMCPY
/**
* memcpy - Copy one area of memory to another
* @dest: Where to copy to
* You should not use this function to access IO space, use memcpy_toio()
* or memcpy_fromio() instead.
*/
-#undef memcpy
void * memcpy(void * dest,const void *src,size_t count)
{
char *tmp = (char *) dest, *s = (char *) src;
return dest;
}
+#endif
#ifndef __HAVE_ARCH_MEMMOVE
/**
* This looks horribly ugly, but the compiler can optimize it totally,
* as the count is constant.
*/
-static inline void * __constant_memcpy(void * to, const void * from, size_t n)
+static always_inline void * __constant_memcpy(void * to, const void * from, size_t n)
{
switch (n) {
case 0:
}
#define __HAVE_ARCH_MEMCPY
-
-#define memcpy(t, f, n) \
-(__builtin_constant_p(n) ? \
- __constant_memcpy((t),(f),(n)) : \
- __memcpy((t),(f),(n)))
-
+static always_inline __attribute_used__
+void memcpy(void *t, const void *f, size_t n)
+{
+ (__builtin_constant_p(n) ?
+ __constant_memcpy((t),(f),(n)) :
+ __memcpy((t),(f),(n)));
+}
/*
* struct_cpy(x,y), copy structure *x into (matching structure) *y.
* This looks horribly ugly, but the compiler can optimize it totally,
* as we by now know that both pattern and count is constant..
*/
-static inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count)
+static always_inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count)
{
switch (count) {
case 0: